package com.zbf.web;

import com.alibaba.fastjson.JSON;
import com.zbf.dao.MyGoodsDao;
import com.zbf.dao.MyRoleDao;
import com.zbf.dao.MyUserDao3;
import com.zbf.entity.Goods;
import com.zbf.entity.MyUser;
import com.zbf.entity.Role;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2021/6/25  11:41
 * 描述:
 */
@RestController
public class TestController {

    @Autowired
    private MyUserDao3 myUserDao3;

    @RequestMapping("oto")
    public Object testOneToOne(){
        MyUser myUser = myUserDao3.findById(1L).get();
        return myUser;
    }


    @Autowired
    private MyGoodsDao myGoodsDao;

    @RequestMapping("mto")
    public Object test14(){

        Goods goods = myGoodsDao.findById(1L).get();

        System.out.println();

        return goods;
    }


    @Autowired
    MyRoleDao myRoleDao;

    @RequestMapping("mtm")
    public Object test15(){

        Role role = myRoleDao.findById(2L).get();

        System.out.println();

        return role.getListMenu().get(0);
    }




}
